<?php
/**
 * Created by PhpStorm.
 * User: a4041
 * Date: 2018/6/13
 * Time: 13:46
 */

namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class BannerItem extends Model
{
    protected $table = 'banner_item';
    protected $guarded = ['id'];

//    const CREATED_AT = 'create_time';
//    const UPDATED_AT = 'update_time';
    protected $hidden = ['banner_id','img','img_type'];
    protected $appends = ['image'];
    public function getImageAttribute()
    {
        $img = $this->attributes['img'];  // $this->attributes表的字段属性
        return config('app.url').$img;
    }
}